<template>
</template>

<script lang="ts">
export default {
  name: 'AMapLoader'
}
</script>
<script lang="ts" setup>
import {load} from '@amap/amap-jsapi-loader'
import {onMounted} from 'vue'

const emit = defineEmits<{ (e: 'loaded'): void }>()

onMounted(() => {
  const options = {
    key: "4093a7c4a56f5a94a505362f571832b5",
    version: "2.0",
    plugins: ['AMap.Geolocation', 'AMap.Driving'],
    AMapUI: {
      version: '1.1',
      plugins: ['control/BasicControl', 'misc/PoiPicker']
    }
  }
  load(options).then(() => emit('loaded'))
})


</script>
